Skip to content

Mabofoul/step by step#3

Merged
NoneSince merged 10 commits into
masterfrom
mabofoul/step_by_step
Jan 25, 2024
Merged

Mabofoul/step by step#3
NoneSince merged 10 commits into
masterfrom
mabofoul/step_by_step

Conversation

@NoneSince

Copy link
Copy Markdown
Owner

No description provided.

The reason: i want to push the changs one step at a time to make it easier to review.
src/*: whitespaces
src/construct.cpp: added a note you explained in the youtube video
README.md: added eexplaination for "-o" flag
warning 2: functions missing return statements
warning 3: for loop index is of type int but is compared to a value of type size_t
…t. also it is used in src/construct_flags.cpp so i added declaration.

con_type looks like the token types while also being only used in the file itself so i renamed to _con_type.
apply_macro_to_token() is used only in the file itself, so i set it as static and removed it from the header.
cstring is included for strcmp. so I replaced it with std::string comparison.
boost is used for split, is_any_of, and to_lower. so I implemented the functionality we need.
… the types and functions you directly use, and not depend on the current header files to complete the needed includes.

for example: the file src/construct_flags.h only needs to know the type std::string, so only #include <string>, and since the function implementation appears in src/construct_flags.cpp, it also needs an #include <string>.
you should put that same include in both .h and .cpp files, since technically the .h file can be empty, then it won't have includes for arguments types, the .cpp has to do the includes.
explaination for the importance of this rule: i remember something like this: <string> under one compiler / operating system does #include <algorithm> inside the header, so the program in the story ran filne without noticing the need of direct #include <algorithm>. once the same code was compiled with a different compiler / OS, it failed compilation since <algorithm> was not included.
…hrow error;".

before, an error could go unnoticed, but now the program will end automatically (I didn't do try-catch)
@NoneSince NoneSince self-assigned this Jan 25, 2024
@NoneSince NoneSince merged commit 8c1105b into master Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant